/*
Date:20220103 19:28
key:要判断新矩阵放不放得下原数组总个数
*/
class Solution {
public:
    vector<vector<int>> construct2DArray(vector<int>& original, int m, int n) {
        vector<vector<int>> newarrat;
        if(original.size()!=m*n){ return newarrat;}
        newarrat.resize(m);
        for(int j=0,i=0;j<original.size();)
        {
            newarrat[i].resize(n);
            for(int k=0;k<n;k++)
            {
                newarrat[i][k]=original[j];
                j++;
            }
            i++;
        }
        return newarrat;
    }
};